#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include<assert.h>

char* my_strncat(char* dest, const char* src, size_t num)
{
	char* ret = dest;
	assert(dest && src);
	while (*dest != '\0')
	{
		dest++;
	}
	while (num--)
	{
		if (*src == '\0')
		{
			*dest = *src;
			return ret;
		}
		*dest = *src;
		dest++;
		src++;
	}
	return ret;
}


int main()
{
	char arr1[20] = "I can ";
	char arr2[10] = "do it!";
	printf("%s \n", my_strncat(arr1, arr2, 2));
	return 0;
}